package com.feedback.ui;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.feedback.a.a;
import com.feedback.a.c;
import com.feedback.a.d;
import com.feedback.b.d;
import com.mobclick.android.t;
import java.util.List;

public class c extends BaseAdapter
{
  Context a;
  LayoutInflater b;
  String c;
  String d = "FeedbackAdapter";
  com.feedback.a.d e;

  public c(Context paramContext, com.feedback.a.d paramd)
  {
    this.a = paramContext;
    this.e = paramd;
    this.b = LayoutInflater.from(paramContext);
  }

  private void a(a parama, TextView paramTextView)
  {
    String str;
    switch (a()[parama.g.ordinal()])
    {
    case 3:
    default:
      str = com.feedback.b.d.b(parama.e, this.a);
      if (!("".equals(str)))
        break label161;
      paramTextView.setText("");
    case 1:
    case 2:
    case 4:
    }
    while (true)
    {
      while (true)
      {
        while (true)
        {
          while (true)
          {
            return;
            paramTextView.setText(this.a.getString(t.a(this.a, "string", "UMFb_Atom_State_Sending")));
            paramTextView.setTextColor(-7829368);
          }
          paramTextView.setText(this.a.getString(t.a(this.a, "string", "UMFb_Atom_State_Fail")));
          paramTextView.setTextColor(-65536);
        }
        paramTextView.setText(this.a.getString(t.a(this.a, "string", "UMFb_Atom_State_Resending")));
        paramTextView.setTextColor(-65536);
      }
      label161: paramTextView.setText(str);
      paramTextView.setTextColor(-7829368);
    }
  }

  public void a(com.feedback.a.d paramd)
  {
    this.e = paramd;
  }

  public int getCount()
  {
    int i;
    if (this.e == null)
      i = 0;
    while (true)
    {
      return i;
      i = this.e.f.size();
    }
  }

  public Object getItem(int paramInt)
  {
    return Integer.valueOf(paramInt);
  }

  public long getItemId(int paramInt)
  {
    return paramInt;
  }

  public View getView(int paramInt, View paramView, ViewGroup paramViewGroup)
  {
    d locald1;
    View localView;
    if (paramView == null)
    {
      localView = this.b.inflate(t.a(this.a, "layout", "umeng_analyse_feedback_conversation_item"), null);
      d locald2 = new d(this);
      locald2.a = ((LinearLayout)localView.findViewById(t.a(this.a, "id", "umeng_analyse_atomLinearLayout")));
      locald2.b = ((RelativeLayout)locald2.a.findViewById(t.a(this.a, "id", "umeng_analyse_bubble")));
      locald2.c = ((TextView)locald2.a.findViewById(t.a(this.a, "id", "umeng_analyse_atomtxt")));
      locald2.d = ((TextView)locald2.a.findViewById(t.a(this.a, "id", "umeng_analyse_stateOrTime")));
      locald2.e = localView.findViewById(t.a(this.a, "id", "umeng_analyse_atom_left_margin"));
      locald2.f = localView.findViewById(t.a(this.a, "id", "umeng_analyse_atom_right_margin"));
      localView.setTag(locald2);
      locald1 = locald2;
      a locala = this.e.a(paramInt);
      a(locala, locald1.d);
      locald1.c.setText(locala.a());
      if (locala.f != com.feedback.a.c.c)
        break label303;
      locald1.a.setGravity(5);
      locald1.b.setBackgroundResource(t.a(this.a, "drawable", "umeng_analyse_dev_bubble"));
      locald1.f.setVisibility(8);
      locald1.e.setVisibility(0);
    }
    while (true)
    {
      while (true)
      {
        return localView;
        locald1 = (d)paramView.getTag();
        localView = paramView;
      }
      label303: locald1.a.setGravity(3);
      locald1.b.setBackgroundResource(t.a(this.a, "drawable", "umeng_analyse_user_bubble"));
      locald1.f.setVisibility(0);
      locald1.e.setVisibility(8);
    }
  }
}